
package com.kensure.shike.card.service;

import com.kensure.shike.card.dao.CardHuodongDao;
import com.kensure.shike.card.model.CardHuodong;
import com.kensure.shike.card.service.CardHuodongService;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import co.kensure.frame.JSBaseService;
import co.kensure.mem.MapUtils;


/**
 * 卡活动服务实现类
 * @author fankd created on 2019-6-28
 * @since 
 */
@Service
public class CardHuodongService extends JSBaseService{
	
	@Resource
	private CardHuodongDao dao;
    
    
    public CardHuodong selectOne(Long id){
    	return dao.selectOne(id);
    }
	
	public List<CardHuodong> selectByIds(Collection<Long> ids){
		return dao.selectByIds(ids);
	}
	
	public List<CardHuodong> selectAll(){
		return dao.selectAll();
	}
	
	public List<CardHuodong> selectByWhere(Map<String, Object> parameters){
		return dao.selectByWhere(parameters);
	}

	
	public long selectCountByWhere(Map<String, Object> parameters){
		return dao.selectCountByWhere(parameters);
	}
	
	
	public boolean insert(CardHuodong obj){
		return dao.insert(obj);
	}
	
	public boolean insertInBatch(List<CardHuodong> objs){
		return dao.insertInBatch(objs);
	}
	
	
	public boolean update(CardHuodong obj){
		return dao.update(obj);
	}
    
    public boolean updateByMap(Map<String, Object> params){
		return dao.updateByMap(params);
	}
    
    
	public boolean delete(Long id){
		return dao.delete(id);
	}	
	
    public boolean deleteMulti(Collection<Long> ids){
		return dao.deleteMulti(ids);
	}
    
    public boolean deleteByWhere(Map<String, Object> parameters){
		return dao.deleteByWhere(parameters);
	}
    
    /**
     * 获取vip卡劵
     * @return
     */
    public List<CardHuodong> getVip(){
    	Map<String, Object> parameters = MapUtils.genMap("typeid",1);
    	List<CardHuodong> list = selectByWhere(parameters);
    	return list;
    }
  

}
